#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QPushButton>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QPushButton* button =new QPushButton("this is a button",this);

    //呐，这就是lambda表达式
    connect(button,&QPushButton::clicked,this,[=](){
        qDebug()<<"按钮按下"<<endl;
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}

